Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

npm start - process.env.PORT support #117

Closed
wants to merge 2 commits into from
Closed

npm start - process.env.PORT support #117

wants to merge 2 commits into from

Conversation

dolchi21
Copy link

run "PORT=3001 npm start" to start the app at port 3001

@ghost
Copy link

ghost commented Jul 23, 2016

Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla - and if you have received this in error or have any questions, please drop us a line at cla@fb.com. Thanks!

@tyrbo
Copy link

tyrbo commented Jul 23, 2016

Would love it if the host was configurable as well.

@@ -77,7 +78,7 @@ compiler.plugin('done', function (stats) {
if (!hasErrors && !hasWarnings) {
console.log(chalk.green('Compiled successfully!'));
console.log();
console.log('The app is running at http://localhost:3000/');
console.log('The app is running at http://localhost:'+PORT+'/');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the minimum requirement is Node 4 can't we use template strings for these?

@gaearon
Copy link
Contributor

gaearon commented Jul 23, 2016

Can you please describe your use case for customizing the port? Do you want to run two instances of the app? Do you have another tool at this port?

@dolchi21
Copy link
Author

dolchi21 commented Jul 23, 2016

Yes. I have an express app at port 3000 behind a nginx proxy. If the react app wants to run on 3000 i would have to modify the nginx conf and the express app.
another:
running the /user and the /admin apps at the same time

@gaearon
Copy link
Contributor

gaearon commented Jul 23, 2016

I think we’ll go with something like #101 for now.

We might add support for specifying the port in the future but it seems like #101 would be a good enough solution for most people (and it should cover both your use cases).

What do you think?

@dolchi21
Copy link
Author

i think is just a matter of preference. i'm used to ExpressJS where you set env.PORT to whatever you like.
Whatever works is fine with me.

@mxstbr
Copy link
Contributor

mxstbr commented Jul 24, 2016

Awesome, I'll close this for now then and get #101 merged. Thanks so much for taking the time to contribute @dolchi21!

@mxstbr mxstbr closed this Jul 24, 2016
@gaearon
Copy link
Contributor

gaearon commented Jul 24, 2016

Yep. We might revisit this later.

kalekseev pushed a commit to kalekseev/create-react-app that referenced this pull request Sep 11, 2017
@lock lock bot locked and limited conversation to collaborators Jan 22, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants